package com.by.controller;


import com.by.core.bean.ResultBean;
import com.by.core.controller.BaseController;
import com.by.entity.Order;
import com.by.entity.dto.OrderDto;
import com.by.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
@Api(tags = "订单管理")
public class OrderController extends BaseController {


    @Autowired
    private OrderService orderService;

    /**
     * 创建订单信息
     * @return
     */
    @GetMapping("/createOrder")
    @ApiOperation(value = "创建订单信息")
    public ResultBean<Order> createOrder(@RequestBody OrderDto orderDto){
        Order order = orderService.createOrder(orderDto);
        return success("查询成功", order);
    }







}
